home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6602 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  751 b 

  1. Path: news.erg.cuhk.hk!ywleung
  2. From: ywleung@cs.cuhk.hk (Marty McFly)
  3. Newsgroups: comp.lang.c++
  4. Subject: How to delete array of pointers?
  5. Date: 10 Feb 1996 02:28:46 GMT
  6. Organization: Engineering Faculty CUHK
  7. Message-ID: <4fgvsu$5q4@eng_ser1.erg.cuhk.hk>
  8. NNTP-Posting-Host: sun12.cs.cuhk.hk
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. If I write the following code in a function:
  12.  
  13.     int** ptr;
  14.     ptr = new int*[1000];
  15.  
  16. Is this code means allocating 1000 integer pointers which is pointed by ptr?
  17. And then somehow I assign integer variable to ptr[0], ptr[1], ... and so on.
  18. So at the end of the function, how can I reclaim just those pointers?  The key
  19. point is that those integer variable assigned to the pointers should not be 
  20. deleted.
  21.  
  22. Regards,
  23. Marty McFly.
  24.